{php define(MUI, true);}
{template 'common/header'}
<header class="mui-bar mui-bar-nav">
	<h1 class="mui-title">布噜么么核销</h1>
</header>
<div class="mui-content">
	<form action="" method="post" class="mui-mt15">
		<div class="mui-input-group">
			<div class="mui-input-row">
				<input type="text" name="mobile" value="{$qrcode}" placeholder="请输入手机号"/>
			</div>
		</div>
		<div class="mui-content-padded">
			<button class="mui-btn mui-btn-success mui-btn-block syscard-check">核 销</button>
		</div>
	</form>
	<div class="mui-content-padded">
		<a href="{php echo $this->createMobileUrl('clerk', array('op' => 'logout'))}" class="mui-btn mui-btn-block mui-btn-danger mui-btn-outlined">退出登录</a>
	</div>
</div>
<script type="text/javascript">
	$('.syscard-check').click(function(){
		var mobile = $.trim($('input[name="mobile"]').val());
		if(!mobile) {
			alert('手机号错误');
			return false;
		}
		$.post("{php echo $this->createMobileUrl('clerk', array('op' => 'cardmobile_bu'));}", {mobile:mobile}, function(data) {
			var data = $.parseJSON(data);
			if(data.message.errno == -1) {
				alert(data.message.message);
			} else {
				alert('核销成功');
				//location.href = "{php echo $this->createMobileUrl('clerk', array('op' => 'home'))}";
			}
		});
		return false; 
	});
</script>
